#coding=utf-8

#http://pypi.douban.com/packages/source/r/requests/requests-2.5.1.tar.gz#md5=c270eb5551a02e8ab7a4cbb83e22af2e
#python setup.py install

def tostr(row):
	s=u'{date}：{type}，{high}，{low}，{fengli} {fengxiang}'.format(fengxiang=row['fengxiang'], high=row['high'], fengli=row['fengli'], date=row['date'], type=row['type'], low=row['low'])
	return s
	
import requests
r = requests.get('http://wthrcdn.etouch.cn/weather_mini?city=合肥')
s=r.text

import json
o=json.loads(s)
if o['desc']<>u'OK':
	print '出错：desc不是ok，请手工获取'
	exit(1)

ls= o['data']['forecast']
# disp='\r\n'.join ( [ ','.join( [ '%s:%s' % (k,row[k]) for k in row.keys() ] ) for row in ls ] )
disp='\r\n'.join ( [ tostr(row) for row in ls ] )
# row= [  row for row in ls ]  [0] 
# print [ '%s:%s' % (k,v) for k in row ]
print disp
